package com.example.points.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.points.domain.PointsDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

public interface PointsDetailMapper extends BaseMapper<PointsDetail> {
    @Select("SELECT * FROM points_detail WHERE status = 1 " +
            "AND expire_time <= #{expireTime} AND deleted = 0")
    List<PointsDetail> findExpiringPoints(@Param("userId") Long userId, @Param("expireTime") LocalDateTime expireTime);
} 